import { messages } from 'share/common';
import verticalBarImg from 'images/data-center/custom-report/vertical-bar.png';
import horizonBarImg from 'images/data-center/custom-report/horizon-bar.png';
import tableImg from 'images/data-center/custom-report/table.png';
import areaImg from 'images/data-center/custom-report/area.png';
import lineImg from 'images/data-center/custom-report/line.png';
import pieImg from 'images/data-center/custom-report/pie.png';
import radarImg from 'images/data-center/custom-report/radar.png';
import indicatrixImg from 'images/data-center/custom-report/indicatrix.png';
import perspectiveImg from 'images/data-center/custom-report/perspective.png';
import fakeIndicatrixImg from 'images/data-center/custom-report/fake-indicatrix.png';
import FakeVerticalBarImg from 'images/data-center/custom-report/fake-vertical-bar.jpg';
import FakeHorizonBarImg from 'images/data-center/custom-report/fake-horizon-bar.jpg';
import FakeTableImg from 'images/data-center/custom-report/fake-table.jpg';
import FakeAreaImg from 'images/data-center/custom-report/fake-area.jpg';
import FakeLineImg from 'images/data-center/custom-report/fake-line.jpg';
import FakePieImg from 'images/data-center/custom-report/fake-pie.jpg';
import FakeRadarImg from 'images/data-center/custom-report/fake-radar.jpg';
import FakePerspectiveImg from 'images/data-center/custom-report/fake-perspective.jpg';

//图表小图标 icon map
const iconMap = {
  'indicatrix': indicatrixImg,
  'histogram': verticalBarImg,
  'horizon-histogram': horizonBarImg,
  'detail_list': tableImg,
  'area': areaImg,
  'broken_line': lineImg,
  'pie': pieImg,
  'radar': radarImg,
  'perspective': perspectiveImg
};

//图表 未设置图片 map
const ImgMap = {
  'indicatrix': fakeIndicatrixImg,
  'histogram': FakeVerticalBarImg,
  'horizon-histogram': FakeHorizonBarImg,
  'detail_list': FakeTableImg,
  'area': FakeAreaImg,
  'broken_line': FakeLineImg,
  'pie': FakePieImg,
  'radar': FakeRadarImg,
  'perspective': FakePerspectiveImg
};

//图表 初始化信息
const graphList = [
  {
    chartName: messages('basic-10.key67')/*指标图*/,
    desc: messages('basic-10.key68')/*0~1维度，1指标*/,
    key: 'indicatrix',
    showScreen: 'half',
    style: 'font-m',
    set: false
  },
  {
    chartName: messages('basic-10.key69')/*横向柱状图*/,
    desc: messages('basic-10.key70')/*1维度，1~n指标*/,
    key: 'horizon-histogram',
    showScreen: 'half',
    style: 'font-m',
    showLabelFlag: true,
    set: false
  },
  {
    chartName: messages('basic-10.key71')/*柱状图*/,
    desc: messages('basic-10.key70')/*1维度，1~n指标*/,
    key: 'histogram',
    showScreen: 'half',
    style: 'font-m',
    showLabelFlag: true,
    set: false
  },
  {
    chartName: messages('basic-10.key72')/*面积图*/,
    desc: messages('basic-10.key70')/*1维度，1~n指标*/,
    key: 'area',
    showScreen: 'half',
    style: 'font-m',
    showLabelFlag: true,
    showLegendLocation: 'up',
    set: false
  },
  {
    chartName: messages('basic-10.key73')/*雷达图*/,
    desc: messages('basic-10.key70')/*1维度，1~n指标*/,
    key: 'radar',
    showScreen: 'half',
    style: 'font-m',
    showLabelFlag: true,
    showLegendLocation: 'right',
    set: false
  },
  {
    chartName: messages('basic-10.key74')/*折线图*/,
    desc: messages('basic-10.key70')/*1维度，1~n指标*/,
    key: 'broken_line',
    showScreen: 'half',
    style: 'font-m',
    showLabelFlag: true,
    showLegendLocation: 'up',
    set: false
  },
  {
    chartName: messages('basic-10.key75')/*饼状图*/,
    desc: messages('basic-10.key76')/*1维度，1指标*/,
    key: 'pie',
    showScreen: 'half',
    style: 'font-m',
    showDimensionFlag: true,
    showIndicatorFlag: true,
    showPercentFlag: true,
    showLegendLocation: 'right',
    set: false
  },
  {
    chartName: messages('basic-10.key77')/*透视图*/,
    desc: messages('basic-10.key78')/*1～n维度(行)，0～5维度(列)，1~n指标*/,
    key: 'perspective',
    showScreen: 'half',
    style: 'font-m',
    operateType: 'false',
    showDimensionFlag: true,
    showIndicatorFlag: true,
    showPercentFlag: true,
    set: false
  }
];

//明细表初始化信息
const tableTemplateList = [
  {
    chartName: messages('basic-10.key79')/*表格*/,
    desc: '',
    key: 'detail_list',
    operateType: 'false',
    showScreen: 'half',
    style: 'font-m',
    set: false
  }
];

//筛选器初始化信息
const criteriaTemplateList = [
  {
    chartName: messages('basic-10.key80')/*筛选器*/,
    desc: '',
    key: 'criteria',
    showScreen: 'all',
    style: 'font-m',
    set: false
  }
];

//指标图 单 指标时 字体大小选项List
const fontSizeOptions = [
  {
    fontSize: 14,
    title: 14,
    data: 28,
    key: 'font-s'
  },
  {
    fontSize: 21,
    title: 16,
    data: 36,
    key: 'font-m'
  },
  {
    fontSize: 28,
    title: 18,
    data: 48,
    key: 'font-l'
  },
  {
    fontSize: 35,
    title: 20,
    data: 72,
    key: 'font-xl'
  }
];

//指标图 单 指标时 字体大小选项List map
const fontSizeOptionsObject = {
  'font-s': {
    fontSize: 14,
    title: 14,
    data: 28
  },
  'font-m': {
    fontSize: 21,
    title: 16,
    data: 36
  },
  'font-l': {
    fontSize: 28,
    title: 18,
    data: 48
  },
  'font-xl': {
    fontSize: 35,
    title: 20,
    data: 72
  }
};

//汇总计算方式 map
const summaryWayMap = {
  'sum': messages('basic-10.key81')/*求和*/,
  'avg': messages('basic-10.key82')/*平均*/,
  'max': messages('basic-10.key83')/*最大值*/,
  'min': messages('basic-10.key84')/*最小值*/,
  'count': messages('basic-10.key85')/*计数*/
};

//汇总计算方式 map
const sequenceWayMap = {
  'default_order': messages('basic-10.key86')/*默认*/,
  'desc': messages('basic-10.key87')/*降序*/,
  'asc': messages('basic-10.key88')/*升序*/
};

//图表：维度/指标  明细表：显示字段  筛选器：筛选条件  map
const fieldType = {
  'dimensionRow': messages('basic-10.key233')/*维度(行)*/,
  'dimensionCol': messages('basic-10.key234')/*维度(列)*/,
  'dimension': messages('basic-10.key89')/*维度*/,
  'indicator': messages('basic-10.key90')/*指标*/,
  'show': messages('basic-10.key91')/*显示字段*/,
  'criteria': messages('basic-10.key92')/*筛选条件*/
};

//图表名称 map
const GraphicMap = {
  'indicatrix': messages('basic-10.key67')/*指标图*/,
  'histogram': messages('basic-10.key71')/*柱状图*/,
  'horizon-histogram': messages('basic-10.key69')/*横向柱状图*/,
  'detail_list': messages('basic-10.key79')/*表格*/,
  'area': messages('basic-10.key72')/*面积图*/,
  'broken_line': messages('basic-10.key74')/*折线图*/,
  'pie': messages('basic-10.key93')/*饼图*/,
  'radar': messages('basic-10.key73')/*雷达图*/,
  'perspective': messages('basic-10.key77')/*透视图*/
};

// 不同模式（图表）显示的 维度/指标/展示字段/筛选器
const boxMap = {
  'default': ['dimension', 'indicator'],
  'indicatrix': ['dimension', 'indicator'],
  'histogram': ['dimension', 'indicator'],
  'horizon-histogram': ['dimension', 'indicator'],
  'area': ['dimension', 'indicator'],
  'broken_line': ['dimension', 'indicator'],
  'pie': ['dimension', 'indicator'],
  'radar': ['dimension', 'indicator'],
  'perspective': ['dimensionRow', 'dimension', 'indicator'],
  'criteria': ['criteria'],
  'detail_list': ['show']
}

export {
  iconMap,
  ImgMap,
  graphList,
  tableTemplateList,
  fontSizeOptions,
  GraphicMap,
  fontSizeOptionsObject,
  fieldType,
  criteriaTemplateList,
  sequenceWayMap,
  boxMap,
  summaryWayMap
};
